//Table basic shared vars
$margin: 5px;
$column-width: 300px;
$column-flex: 1;
$column-shrink: 0;
$column-margin: 0 $margin 0 0;
$column-padding: .5rem 1rem;

@mixin fold {
    .card {
        align-self: flex-start;
        margin-top: .5rem;
        tg-card-slideshow,
        .card-unfold,
        .card-tag,
        .card-title,
        .card-owner-actions,
        .card-data,
        .card-statistics,
        .card-owner-name {
            display: none;
        }
        .card-owner {
            img {
                height: 1.3rem;
                margin-right: 0;
                width: 1.3rem;
            }
        }
    }
    &.taskboard-column,
    .taskboard-column {
        align-content: flex-start;
        display: flex;
        flex-direction: column;
        flex-flow: row wrap;
    }
    .avatar-task-link {
        display: block;
    }
    .avatar-assigned-to {
        display: none;
    }
}

.taskboard-table {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    width: 100%;
    &.zoom-0 {
        .task-colum-name span {
            padding-right: 1rem;
        }
    }

    .task-colum-name {
        @include font-size(medium);
        align-items: center;
        background-color: $grey-02;
        border-top: 3px solid $gray-light;
        color: $gray;
        display: flex;
        flex-basis: $column-width;
        flex-grow: $column-flex;
        flex-shrink: $column-shrink;
        justify-content: space-between;
        margin: $column-margin;
        max-width: $column-width;
        padding: $column-padding;
        position: relative;
        text-transform: uppercase;
        width: $column-width;
        &:last-child {
            margin-right: 0;
        }
        &.column-fold {
            align-items: center;
            justify-content: center;
            padding: .3rem 0;
            span {
                display: none;
            }
            .hfold,
            .hunfold {
                margin: 0;
            }
        }
        span {
            @include ellipsis(65%);
        }
    }
}

.taskboard-table-header {
    flex-basis: 2.4rem;
    flex-grow: 0;
    flex-shrink: 0;
    min-height: 2.4rem;
    position: relative;
    width: 100%;
    .taskboard-table-inner {
        display: flex;
        overflow: hidden;
        position: absolute;
    }
    tg-svg {
        display: block;
        margin-right: .3rem;
        &:hover {
            cursor: pointer;
        }
        &.hfold,
        &.hunfold {
            display: inline-block;
            transform: rotate(90deg);
        }
    }
}

.taskboard-table-body {
    flex: 1;
    margin-top: 1px;
    overflow: auto;
    width: 100%;
    .taskboard-column {
        flex-basis: $column-width;
        flex-grow: $column-flex;
        flex-shrink: $column-shrink;
        margin: $column-margin;
        max-width: $column-width;
        width: $column-width;
        &:last-child {
            margin-right: 0;
        }

    }

    .row-fold {
        @include fold;
    }
    .column-fold {
        @include fold;
    }
    .taskboard-row {
        display: flex;
        margin-bottom: .25rem;
        min-height: 10rem;
        width: 100%;
        &.blocked {
            .taskboard-row-title-box {
                background: rgba($red, .6);

            }
            .taskboard-row-title-box svg,
            .taskboard-row-title-box svg:hover,
            .points-value,
            .points-value:hover {
                color: $white;
                fill: $white;
                transition: color .3s linear;
            }
            .status-value,
            .status-value:hover {
                background: $white;
                line-height: 1.75em;
                padding: 0 .7em;
            }
            .taskboard-cards-box {
                background: rgba($red, .1);
            }
        }
        &.row-fold {
            min-height: 0;
            .us-title {
                @include ellipsis(100%);
            }
            .status-value,
            .points-value,
            .us-data,
            .icon-add,
            .icon-bulk {
                display: none;
            }
        }
        &.issues-row {
            margin-top: 1em;
            .taskboard-cards-box {
                align-content: flex-start;
                align-items: flex-start;
                border-top: 3px solid $gray-light;
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                width: 100%;
            }
            .taskboard-row-title-box {
                padding: 0;
            }
            .task-colum-name {
                justify-content: flex-start;
                padding: .5rem .5rem .5rem 2em;
            }
            .row-title {
                flex-grow: 1;
            }
            .toggle-fold {
                display: block;
                left: .5rem;
                position: absolute;
                top: -.4rem;
            }
            .card {
                cursor: default;
                height: auto;
                margin: .3rem .1rem .3rem .5rem;
            }
        }
        &.issues-row:not(.row-fold) {
            .card {
                width: 280px;
            }
        }
    }
    .taskboard-row-title-box {
        padding: .5rem .5rem .5rem 1.5rem;
    }

}

.taskboard-cards-box {
    background-color: $grey-02;
}

.taskboard-row-title-box {
    position: relative;
    .us-title {
        @include font-size(normal);
        @include font-type(text);
        margin-bottom: 0;
        margin-right: 3rem;
    }
    .status-value {
        @include font-size(small);
        display: block;
        margin: .25em 0 0;
        width: fit-content;
        span {
            margin-right: .1rem;
        }
    }
    .points-value {
        @include font-size(small);
        color: $gray-light;
        margin: .25em 0 0;
        width: fit-content;
        span {
            margin-right: .1rem;
        }
    }
    .due-date {
        tg-svg {
            position: inherit;
        }
    }
    tg-svg {
        cursor: pointer;
        display: block;
        position: absolute;
        right: .5rem;
        top: .7rem;
        &:hover {
            svg {
                fill: $primary;
            }
        }
        &.add-action {
            right: 2rem;
        }
        &.fold-action {
            left: 0;
            right: inherit;
            top: 1rem;
        }
    }
}
